package org.demo.pattern.flyweight;
/**
 * 
 * @author  
 * @date    2011-5-20
 * @file    org.demo.pattern.flyweight.CD.java
 */
public class CD {

	private int year;
	
	private String title;
	
	private Artist artist;

	/**
	 * 构造函数
	 * @param year
	 * @param title
	 * @param artist
	 */
	public CD(int year, String title, Artist artist) {
		super();
		this.year = year;
		this.title = title;
		this.artist = artist;
	}

	/**
	 * @return the year
	 */
	public int getYear() {
		return year;
	}

	/**
	 * @param year the year to set
	 */
	public void setYear(int year) {
		this.year = year;
	}

	/**
	 * @return the title
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * @return the artist
	 */
	public Artist getArtist() {
		return artist;
	}

	/**
	 * @param artist the artist to set
	 */
	public void setArtist(Artist artist) {
		this.artist = artist;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("CD [artist=");
		builder.append(artist);
		builder.append(", title=");
		builder.append(title);
		builder.append(", year=");
		builder.append(year);
		builder.append("]");
		return builder.toString();
	}
}
